home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / MantAirBall.swf / scripts / frame_5 / PlaceObject2_10_23 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-05  |  1.7 KB  |  86 lines

  1. onClipEvent(enterFrame){
  2.    if(this._x < _root._xmouse && _root._xmouse - this._x < 70)
  3.    {
  4.       xmove = true;
  5.    }
  6.    if(this._x > _root._xmouse && _root._xmouse - this._x > -70)
  7.    {
  8.       xmove = true;
  9.    }
  10.    if(this._y - _root._ymouse > -100 && this._y - _root._ymouse < 0)
  11.    {
  12.       ymove = true;
  13.    }
  14.    if(yspeed < _root.gravity && this._y <= base)
  15.    {
  16.       yspeed += 0.5;
  17.       _root.score += 1;
  18.    }
  19.    if(this._y + yspeed <= base)
  20.    {
  21.       this._y += yspeed;
  22.    }
  23.    else
  24.    {
  25.       this._y = base;
  26.       yspeed = - yspeed / bounce;
  27.       _root.score = 0;
  28.    }
  29.    if(_root.increasethrust == true)
  30.    {
  31.       if(xmove == true && ymove == true)
  32.       {
  33.          xspeed -= (_root._xmouse - this._x) / weight;
  34.          yspeed -= (100 - (this._y - _root._ymouse)) / weight;
  35.       }
  36.    }
  37.    if(this._y > base)
  38.    {
  39.       this._y = base;
  40.    }
  41.    if(this._x + xspeed < rw)
  42.    {
  43.       this._x += xspeed;
  44.    }
  45.    else
  46.    {
  47.       this._x = rw;
  48.       xspeed = - xspeed / bounce;
  49.       _root.score = 0;
  50.    }
  51.    if(this._x + xspeed > lw)
  52.    {
  53.       this._x += xspeed;
  54.    }
  55.    else
  56.    {
  57.       this._x = lw;
  58.       xspeed = - xspeed / bounce;
  59.       _root.score = 0;
  60.    }
  61.    this._rotation += xspeed * 3;
  62.    _root.ypos = this._y;
  63.    _root.yspeed = yspeed;
  64.    _root.xspeed = xspeed;
  65.    if(xmove == false)
  66.    {
  67.       if(xspeed < 0)
  68.       {
  69.          xspeed += 0.025;
  70.       }
  71.       if(xspeed > 0)
  72.       {
  73.          xspeed -= 0.025;
  74.       }
  75.       if(_root.increasethrust == false)
  76.       {
  77.          if(xspeed > -0.25 and xspeed < 0.25)
  78.          {
  79.             xspeed = 0;
  80.          }
  81.       }
  82.    }
  83.    xmove = false;
  84.    ymove = false;
  85. }
  86.